#include<iostream>
using namespace std;
int main(){
  long long m,k,sum=0;
  cin>>m>>k;
  while(m){
    if(m%10==3)sum++;
    m/=10;
  }
  if(sum==k)cout<<"YES";
  else cout<<"NO";
}